package com.project.controller;

import com.project.dto.TicketDTO;
import com.project.service.MoviesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @title
 * @author: yuyuan
 * @date: 2020/11/30 16:40
 */
@RestController
public class MoviesController {
    @Autowired
    private MoviesService moviesService;

    @PostMapping("/movies/{number}")
    public String buy(@RequestBody TicketDTO ticketDTO, @PathVariable Integer number){
        return moviesService.buyMovieTicket(number,ticketDTO);
    }
}
